<template>
<div class="login-content">
    <transition>
        <router-view></router-view>
    </transition>
    <van-tabbar v-model="active" route>
        <van-tabbar-item replace to="/app/index/main" name="mainPage" icon="home-o">首页</van-tabbar-item>
        <van-tabbar-item replace to="/app/index/order" name="orderPage" icon="orders-o">订单</van-tabbar-item>
        <van-tabbar-item replace to="/app/index/search" name="searchPage" icon="search">查单</van-tabbar-item>
        <van-tabbar-item replace to="/app/index/message" name="messagePage" icon="chat-o">消息</van-tabbar-item>
        <van-tabbar-item replace to="/app/index/personal" name="personalPage" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>
</div>
</template>

<script>
import {
    Toast
} from "vant";
import {
    Dialog
} from "vant";
import eventBus from "@/api/public/eventBus";
// 引入axios请求
import {
    loginRequest
} from "@/api/login/login";
// 引入组件
import mainPage from "@/components/main";
import orderPage from "@/components/order";
import searchPage from "@/components/search";
import messagePage from "@/components/message";
import personalPage from "@/components/personal";
export default {
    // 挂载组件
    components: {
        mainPage,
        orderPage,
        searchPage,
        messagePage,
        personalPage,
    },
    data() {
        return {
            // 离开下单页面
            orderFlag: "",
            // 标题
            title: "首页",
            // 底部tabbar
            active: "mainPage",
            // 账套
            value: "",
            showPicker: false,
        };
    },

    watch: {
        active: function (newData, oldData) {
            oldData === "orderPage" ? (this.orderFlag = true) : (this.orderFlag = "");
        },
    },

    mounted() {
    },
    beforeDestroy() {
        eventBus.$off("retain");
    },
    destroyed() {
    },
    created() {
        this.active = this.$session.get("tabbar");
    },

    methods: {

    },
};
</script>
<style lang="scss" scoped>
.login-content {
    .login-header {
        height: 60px;
        width: 100%;
        color: white;
        line-height: 60px;
        background-color: #1989fa;
    }

    .login-img {
        margin: 5px;

        img {
            width: 300px;
            height: 150px;
        }
    }

    .login-pwd {
        margin: 10px auto;
    }

    .login-footer {
        height: 60px;
        width: 100%;
        line-height: 60px;
        overflow: hidden;
        position: fixed;
        bottom: 0px;
    }
}
</style>
